cmake_minimum_required(VERSION 3.15)
project(oeAware-plugin-cfgo)

set(CMAKE_CXX_STANDARD 11)

option(WITH_DEBUG "debug mode" OFF)

if (WITH_DEBUG)
    message("-- Note: debug mode")
    add_compile_options(-g)
endif()
add_compile_options(-std=c++17 -O2 -fPIC -Wall -Wextra -Wno-write-strings)

# libkperf
message("-- libkperf library path: ${LIB_KPERF_LIBPATH}")
message("-- libkperf include path: ${LIB_KPERF_INCPATH}")

set(tuner_src
    src/plugin_tuner/instance.cpp
    src/plugin_tuner/tuner_sysboost.cpp
    src/utils.cpp
)

add_library(cfgo-tuner SHARED ${tuner_src})

include_directories(cfgo-tuner PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${LIB_KPERF_INCPATH}
)

target_link_libraries(cfgo-tuner kperf sym dl log4cplus boost_system boost_filesystem)
